package cn.zjweu.controller;

import cn.zjweu.mapper.UserMapper;
import cn.zjweu.pojo.User;
import cn.zjweu.utils.ResultUtils;
import cn.zjweu.utils.ResultVo;
import cn.zjweu.utils.StatusCode;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "j简单测试接口")
@RestController
@CrossOrigin
@RequestMapping("/api/v1/user")
public class UserController {

    @Autowired
    private UserMapper userMapper;

    @GetMapping("/getAllUsers")
    public ResultVo getAllBook() {
        List<User> all = userMapper.getAllUsers();
        return ResultUtils.success("获取成功", StatusCode.SUCCESS_CODE, all);
    }
    @PostMapping("/updateUser")
    public ResultVo updateUser() {
        String userId;
        String username;
        String password;
        String trueName;
        String telephone;
        String city;
        String address;
//        userMapper.updateUser()
        return ResultUtils.success("成功", 400, null);
    }
}
